#include "framework.h"



								
#define USER_CONFIG()											P12_PushPull_Mode()

#define EVENT_TEST												0x0001
#define SOFT_TIMER_TEST										0

void core_timer_routine()
{
	SOFT_TIMER_PULSE();
}

void test()
{
	P12 = !P12;
	soft_timer_start(SOFT_TIMER_TEST, 1000);
}


void main(void)
{
	USER_CONFIG();
	timer0_init(TIMER_LOAD_VALUE16(0.001,FOSC,12), core_timer_routine);
	INTERRUPT_ENABLE();
	timer0_start();

	event_manual_register(EVENT_TEST, test);
	soft_timer_manual_register(SOFT_TIMER_TEST, EVENT_TEST);
	soft_timer_start(SOFT_TIMER_TEST, 1000);
	
	for(;;)
	{
		event_pull();
		soft_timer_pull();
	}
}


